#ifndef PERSISTENCE
#define PERSISTENCE

#include <iostream>
#include <string>
#include <cstdlib>
#include <sstream>
#include <list>
#include "sqlite3/sqlite3.h"

using namespace std;

/**  RECEBE O COMANDO SQL (QUERY) DAS CONTROLADORAS PARA PASSAR PARA PERSISTENCIA
*/

class Commando
{
    public:
        Commando(){};
        virtual string query() = 0;
        static int callback(void *, int , char **, char **);
        unsigned long callback_count;
        static list<string> result;
       // static  char  ***dados ;
};

/** CLASSE DE PERSISTENCIA QUE CONECTA , DESCONECTA E EXECUTA AS QUERYS NO BANCO DE DADOS
*/
class Persistence
{
        sqlite3 *db;
        Persistence();
        static Persistence * _instance;
    public:
        static Persistence * Instanciate();
        void Conectar();
        void Desconectar();
        void Executar(Commando *);
        static int callback(void *, int , char **, char **);
};
#endif // PERSISTENCE
